package cn.pconline.autoclub.entity;

import java.util.Date;

import org.apache.commons.lang.StringUtils;
import org.gelivable.dao.Column;
import org.gelivable.dao.Entity;
import org.gelivable.dao.Id;
import org.gelivable.dao.Transient;

/**
 * app车友会通栏
 *
 * @author <a href="mailto:chensy0203@163.com">chensy</a>
 */
@Entity(tableName = "ac_app_banner", logChange = true)
public class AppBanner {

    @Id
    @Column(name = "banner_id")
    private long bannerId;// 主键
    @Column(name = "title")
    private String title;//标题
    @Column(name = "url")
    private String url;//图片URL
    @Column(name = "width")
    private int width;//宽
    @Column(name = "height")
    private int height;//高
    @Column(name = "create_by")
    private long createBy;//创建者
    @Column(name = "update_by")
    private long updateBy;//更新者
    @Column(name = "create_at")
    private Date createAt;//创建时间
    @Column(name = "update_at")
    private Date updateAt;//更新时间
    @Column(name = "thumb_img")
    private String thumbImg;//缩略图
    @Transient
    private String url960x1200;//APP4.0
    @Transient
    private String thumbImg640x800;//APP4.0

    public String getUrl960x1200() {
    	if (StringUtils.isBlank(url)) {
            return "";
        }
        return url.replace("640x230", "960x1200");
	}

	public String getThumbImg640x800() {
		if (StringUtils.isBlank(thumbImg)) {
            return "";
        }
        return thumbImg.replace("190x128", "640x800");
	}

	public String getThumbImg() {
		return thumbImg;
	}

	public void setThumbImg(String thumbImg) {
		this.thumbImg = thumbImg;
	}

	public long getBannerId() {
        return bannerId;
    }

    public void setBannerId(long bannerId) {
        this.bannerId = bannerId;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public int getWidth() {
        return width;
    }

    public void setWidth(int width) {
        this.width = width;
    }

    public int getHeight() {
        return height;
    }

    public void setHeight(int height) {
        this.height = height;
    }

    public long getCreateBy() {
        return createBy;
    }

    public void setCreateBy(long createBy) {
        this.createBy = createBy;
    }

    public long getUpdateBy() {
        return updateBy;
    }

    public void setUpdateBy(long updateBy) {
        this.updateBy = updateBy;
    }

    public Date getCreateAt() {
        return createAt;
    }

    public void setCreateAt(Date createAt) {
        this.createAt = createAt;
    }

    public Date getUpdateAt() {
        return updateAt;
    }

    public void setUpdateAt(Date updateAt) {
        this.updateAt = updateAt;
    }
}
